/**
*      author: Y_Yao
*      created: 2024-11-15 19:25:06
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 1e6 + 7;
int a[N];
int dp[N];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n,k;
    cin >> n >> k;
    for(int i = 1;i <= n;i++)
    {
        cin >> a[i];
    }

    for(int i = 2;i <= n;i++)
    {
        if(a[i] > a[i-1] && i % k != (i - 1) % k)
        {
            dp[i] = dp[i - 1] + 1;
        }
        else dp[i] = dp[i-1];
    }

    for(int i = 1;i <= n;i++)
    {
        cout << dp[i] << " ";
    }

    return 0;
}